﻿#include "dxstdafx.h"
#include "AllowIO.h"
#include "Support/AnalyseTree/AnalyseTree.h"
#include "Support/AnalyseTree/AnalyseTreeExtra.h"

#define INSERT_NODE(C)\
[this](void* vp) { CHECK_RETURN(m_pAllowOper);\
m_pAllowOper->InsertNode(std::make_unique<C>(m_pAllowOper)); }\

CAllowReaderHandle::CAllowReaderHandle()
{
	m_map_OperatorFunction = {
		{ L"custom_tooltip", INSERT_NODE(AnalyseTreeNodeCondition_custom_tooltip) },
		{ L"hidden_tooltip", INSERT_NODE(AnalyseTreeNodeCondition_hidden_tooltip) },
	};
}

void CAllowReaderHandle::SetOperaterPtr(AnalyseTreeNodeCondition*& pNode)
{
	CHECK_RETURN(pNode);
	m_pAllowOper = pNode;
}

bool CAllowReaderHandle::HandleBool(const std::wstring& key, bool b)
{
	return false;
}

bool CAllowReaderHandle::HandleInt(const std::wstring& key, int i)
{
	return false;
}

bool CAllowReaderHandle::HandleDouble(const std::wstring& key, double d)
{
	return false;
}

bool CAllowReaderHandle::HandleString(const std::wstring& key, const std::wstring& str)
{
	return false;
}

bool CAllowReaderHandle::HandleStartObj(const std::wstring& key)
{
	// key是数字 就链接到省份所有者上
	return false;
}

bool CAllowReaderHandle::HandleEndObj()
{
	return false;
}
